/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aaron.platform.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 *
 * @author mac
 */
@Entity
@Table(name = "fgys_project_info")
@SequenceGenerator(name="FGYS_PROJECT_GENERATOR", sequenceName="FGYS_PROJECT_GENERATOR", allocationSize = 1)
@NamedQueries({
    @NamedQuery(name = "FgysProject.findAll", query = "SELECT f FROM FgysProject f")})
public class FgysProject implements Serializable {

    private static final long serialVersionUID = 1L;

    public static final String PROPERTY_PROJECT_ID = "projectId";

    public static final String PROPERTY_PROJECT_CODE = "projectCode";

    public static final String PROPERTY_PROJECT_NAME = "projectName";

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator="FGYS_PROJECT_GENERATOR")
    @Column(name = "project_id")
    private Integer projectId;

    /** 项目编号 */
    @Column(name = "project_code")
    private String projectCode;

    /** 项目名称 */
    @Column(name = "project_name")
    private String projectName;

    /** 项目概算 */
    @Column(name = "project_budget")
    private float projectBudget;

    /** 订单录入金额 */
    @Column(name = "order_amount")
    private float orderAmount;

    /** 订单接受金额 */
    @Column(name = "recept_amount")
    private float receptAmount;

    /** 结算金额 */
    @Column(name = "settle_amount")
    private float settleAmount;

    /** 转资金额 */
    @Column(name = "assets_amount")
    private float assetsAmount;

    /** 物理站点列表 */
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "projectInfo", fetch = FetchType.LAZY)
    private List<FgysLogicalSite> fgysLogicalSiteList;

    /** 项目订单列表 */
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "projectInfo", fetch = FetchType.LAZY)
    private List<FgysOrderInfo> fgysOrderInfoList;

    /** 项目合同列表 */
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "projectInfo", fetch = FetchType.LAZY)
    private List<FgysContract> fgysContractList;

    public FgysProject() {
    }

    public FgysProject(Integer projectId) {
        this.projectId = projectId;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public float getProjectBudget() {
        return projectBudget;
    }

    public void setProjectBudget(float projectBudget) {
        this.projectBudget = projectBudget;
    }

    public float getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(float orderAmount) {
        this.orderAmount = orderAmount;
    }

    public float getReceptAmount() {
        return receptAmount;
    }

    public void setReceptAmount(float receptAmount) {
        this.receptAmount = receptAmount;
    }

    public float getSettleAmount() {
        return settleAmount;
    }

    public void setSettleAmount(float settleAmount) {
        this.settleAmount = settleAmount;
    }

    public float getAssetsAmount() {
        return assetsAmount;
    }

    public void setAssetsAmount(float assetsAmount) {
        this.assetsAmount = assetsAmount;
    }

    public List<FgysLogicalSite> getFgysLogicalSiteList() {
        return fgysLogicalSiteList;
    }

    public void setFgysLogicalSiteList(List<FgysLogicalSite> fgysLogicalSiteList) {
        this.fgysLogicalSiteList = fgysLogicalSiteList;
    }

    public List<FgysOrderInfo> getFgysOrderInfoList() {
        return fgysOrderInfoList;
    }

    public void setFgysOrderInfoList(List<FgysOrderInfo> fgysOrderInfoList) {
        this.fgysOrderInfoList = fgysOrderInfoList;
    }

    public List<FgysContract> getFgysContractList() {
        return fgysContractList;
    }

    public void setFgysContractList(List<FgysContract> fgysContractList) {
        this.fgysContractList = fgysContractList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (projectId != null ? projectId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof FgysProject)) {
            return false;
        }
        FgysProject other = (FgysProject) object;
        if ((this.projectId == null && other.projectId != null) || (this.projectId != null && !this.projectId.equals(other.projectId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.aaron.platform.entity.FgysProject[projectId=" + projectId + "]";
    }
}
